// 自己项目中的语言包
import enLocale from './en'
import zhLocale from './zh'
// element ui日历 message组件的语言包
import elementEnLocale from 'element-ui/lib/locale/lang/en' // element-ui lang
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'// element-ui lang

import Vue from 'vue'
import VueI18n from 'vue-i18n'
import Cookie from 'js-cookie'

Vue.use(VueI18n)

export default new VueI18n({
  locale: Cookie.get('language') || 'zh', // 设置当前的语言

  // 可选的语言
  messages: {
    en: {
      ...enLocale,
      ...elementEnLocale
    },
    zh: {
      ...zhLocale,
      ...elementZhLocale
    }
  }
})
